/* Yet Another Experimental Software Renderer
 *
 * Copyright (c) 2010 Pawel "Hery" Dziepak
 */

#ifndef OUTPUT_MERGER_H_
#define OUTPUT_MERGER_H_

#include "pixel_output.h"

namespace yaesr {
	class output_merger {
	public:
		virtual void draw(int x, int y, color clr, double z) = 0;

		int get_width() {
			return next->get_width();
		}

		int get_height() {
			return next->get_height();
		}

		virtual void set_next(pixel_output *po) {
			Assert(po != NULL);

			next = po;
		}

	protected:
		pixel_output *next;
	};

	class default_om : public output_merger {
	public:
		default_om() : depth(NULL) {}

		void draw(int x, int y, color clr, double z);

		void set_next(pixel_output *po);
	private:
		texture *depth;
	};
}

#endif